package com.example.riskmanage.controller;

import com.example.riskmanage.bean.Project;
import com.example.riskmanage.service.ProjectManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProjectController {

    @Autowired
    ProjectManager projectManager;
    @RequestMapping("/project")
    public String project(Integer id) {
        //获取最大列表数和当前编号
        String RESPONE = projectManager.getProjectService(id);
        return RESPONE;
    }
    @RequestMapping("/addproject")
    public String add(@RequestBody Project project){
        String flag=projectManager.addProjectService(project);
        return flag;
    }
    @RequestMapping("/deleteproject")
    public String delete(Integer id){
        String flag=projectManager.deleteProjectService(id);
        return flag;
    }
    @RequestMapping("/getupdateproject")
    public String edit(Integer id)
    {
        String RESPONE = projectManager.geteditService(id);
        return RESPONE;
    }
    @RequestMapping("/editproject")
    public String edits( Project project){
        String flag1=projectManager.editProjectService(project);
        return flag1;
    }
}
